package edu.sctu.wujiayi.month05.homeworkV1;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by user11 on 2015/5/17.
 */
public class TextOne extends TextMore{

    public void getTercherInfo(){

        List<Teacher> list = sotrNumber();

        for (int i = 0; i < list.size(); i++) {
            System.out.println("******"+list.get(i).getName()+"******");
            System.out.println("工号："+list.get(i).getNumber()+"\t职称："+list.get(i).getTitle()+"\t性别："+list.get(i).getSex()+"课程："+list.get(i).getLesson());
            System.out.println("******"+list.get(i).getName()+"******");
            System.out.println("所教学生：");

            for (int j = 0; j < list.get(i).getStudent().size(); j++) {
                System.out.println("\t"+list.get(i).getStudent().get(j).getName());
            }

        }

    }

    public void getStudent(int code,List<Student> list){

        List<Student> list1 = new ArrayList<>();
        for (int i = 0;i < list.size();i++){

            if(list.get(i).getGradle()>code){

                list1.add(list.get(i));
            }


        }

        for(int i = 0;i<list1.size();i++){
            System.out.println(list1.get(i).getName());
        }


    }

    InterMod inter = new InterMod() {
        @Override
        public void method(List<Student> list) {
            getStudent(65,list);
        }
    };
    public void getCode(){
        List<Teacher> teacherlist ;

        List<Student> student = new ArrayList<>();

        teacherlist = pritCoded();

        for(int i = 0;i<teacherlist.size();i++){

            for (int j = 0;j<teacherlist.get(i).getStudent().size();j++){

                student.add(teacherlist.get(i).getStudent().get(j));
            }
        }

    inter.method(student);
    }

}
